<?php
error_reporting(E_ALL ^ E_NOTICE);
if (version_compare(phpversion(), '5.1.0', '<') == true) { die ('PHP5.1 Only'); }

//incluim la seguretat sso
//define(APLICATIU_SSO,"personal");
//include('sso/control_sso.php');

// Constants:
define ('DIRSEP', DIRECTORY_SEPARATOR);

// Get site path
$site_path = realpath(dirname(__FILE__) . DIRSEP . '..' . DIRSEP) . DIRSEP;
define ('site_path', $site_path);

include('lang_ca.php');
// Afegeim propel 
require_once 'propel/Propel.php';
Propel::init(site_path."includes/scriptserver-conf.php");


//afegim aix� per a que les classes generades per propel funcionen  
set_include_path(site_path."app:" . get_include_path());


// For loading classes
function __autoload($class_name) {

	//$filename = strtolower($class_name) . '.php';
	$filename = $class_name . '.php';
	$file = site_path . 'mvc' . DIRSEP . $filename;

	//carregem les calsses MVC
	
	if (file_exists($file) == true) { 
		include ($file);		
	} else {		$file = site_path . 'app' . DIRSEP . $filename;
		//carregem les calsses de la aplicació
	
		if (file_exists($file) == true) { 
			include ($file);		
		}
	}		
	$ok =file_exists($file); 

	return ($ok);

}